package com.culture.bootdemo.handler.handler1;

import com.culture.bootdemo.common.exception.BusinessException;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Author: itsupport
 * @DateTime: 2023/8/22 14:25
 * @Description:
 **/
@Service
public class Demo2ExcelHandler implements ExcelHeadValidHandler{

    @Override
    public void valid(Map<Integer, String> headMap, int num) {
        if (num == 1) {
            //读取第1行的表头
            if (!headMap.get(0).equals("姓名xxxxxxxxx")) {
                throw new BusinessException("模板不正确");
            }
        }
    }
}
